//
//  ViewMaintainLogViewController.m
//  YunKang
//
//  Created by leoking870 on 2017/10/1.
//  Copyright © 2017年 leoking870. All rights reserved.
//

#import "YKViewMaintainLogViewController.h"
#import "YKHospitalLogHeaderView.h"
#import "YKClientMaintainLogItem.h"
#import "YKClientListHeaderView.h"
@interface YKViewMaintainLogViewController ()

@end

@implementation YKViewMaintainLogViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"查看维护日志";
    
    
    YKHospitalLogHeaderView *headerView = [[[NSBundle mainBundle] loadNibNamed:@"YKHospitalLogHeaderView" owner:self options:nil] lastObject];
    headerView.mYKClientDataDetail = self.mYKClientDataDetail;
    [self.view addSubview:headerView];
    
    [headerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.top.trailing.equalTo(self.view);
    }];
    
    YKClientListHeaderView* listHeaderView = [[YKClientListHeaderView alloc]initWithTitles:@[@"维护人",@"维护日期"] weights:@[@1,@1]];
    listHeaderView.textFont = [UIFont systemFontOfSize:16];
    listHeaderView.backgroundColor = [UIColor tf_colorWithHexString:@"#1EADFC"];
    [self.view addSubview:listHeaderView];
    [listHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(headerView.mas_bottom);
    }];
    
    [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.leading.bottom.trailing.equalTo(self.view);
        make.top.equalTo(listHeaderView.mas_bottom);
    }];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

    self.dataSource.totalPageKey = @"page.totalpage";
    self.dataSource.currentPageKey = @"curpage";
    [self startLoadData];
}

- (NSDictionary *)pageViewControllerParameters {
    return @{
             kTFPageViewControllerItemClass: [YKClientMaintainLogItem class],
             kTFPageViewControllerModelClass:[YKClientMaintainLogModel class],
             kTFPageViewControllerRequestURL:@"customerDataOperLog/customerDataOperLogList.htm",
             kTFPageViewControllerDataKeyPath:@"list",
             kTFPageViewControllerRequestParameter:@{@"cId":self.mYKClientDataDetail.ID}
             };
}



@end


